<?php

namespace common\models\base;

use Yii;

/**
 * This is the model class for table "{{%base_district}}".
 *
 * @property int $id 地区ID
 * @property string $name 地区名称
 * @property int $level 层级
 * @property int $usetype
 * @property string $upid 父级地区ID
 * @property int $listorder 显示排序
 */
class BaseDistrict extends \common\db\ActiveRecord {

    /**
     * @inheritdoc
     */
    public static function tableName() {
        return '{{%base_district}}';
    }

    /**
     * @inheritdoc
     */
    public function rules() {
        return [
            [['name'], 'required'],
            [['upid', 'listorder'], 'integer'],
            [['name'], 'string', 'max' => 100],
            [['level', 'usetype'], 'string', 'max' => 1],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels() {
        return [
            'id' => '地区ID',
            'name' => '地区名称',
            'level' => '层级',
            'usetype' => 'Usetype',
            'upid' => '父级地区ID',
            'listorder' => '显示排序',
        ];
    }

}
